package leetcode;


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

/**
 * create by duanx 2022/2/7
 *
 * @classname: Test3
 * @author: duanx
 * @date: 2022/2/7 9:22
 **/
public class Test10 {

    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String str;
        try {
            while (!(str = reader.readLine()).isEmpty()) {
                if (str.length() > 4) {
                    return;
                }
                int n = Integer.parseInt(str);
//                List<String> strings = new ArrayList<>();
                String[] strings = new String[n];
                for (int i = 0; i < n; i++) {
                    String string = reader.readLine();
//                    strings.add(string);
                    strings[i] = string;
//                    Collections.sort(strings);

                }
                Arrays.sort(strings);
                for (String s : strings) {
                    System.out.println(s);
                }
            }
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

    }


}
